<div id="maincontent">

<%= render :partial => "shared_common_files/data_area_help_bar" %>

<% for name in [:simplemsg] %>
    <% if flash[name] %>
      <%= "<div class='message-justmsg'> #{flash[name]} </div>" %>
    <% end %>
  <% end %>
  
    <% for name in [:notice, :warning, :message] %>
    <% if flash[name] %>
      <%= "<div class='message-fatal'> #{flash[name]} </div>" %>
    <% end %>
  <% end %>
<h2>Manage Roles</h2>
<h5>List of all roles</h5>

<div  class="list">



<table id="role_list">
  <tr>
  <td class='pagination' colspan='5'>
  <%= pagination_links @role_pages %>
</td></tr>
<% for column in @content_columns %>
    <th><%= column.human_name %></th>
<% end %>
    <th>Actions</th>
  
 
<% count=1;%>	  
<% rowtype="odd";%>
 
<% for role in @roles %>
<%if(isodd(count))%>
   <% rowtype="odd";%>
<%else%>
  <% rowtype="even";%>
<%end%>     

  <tr class="<%=rowtype%>">
  <% for column in @content_columns %>
  <%@names = h role.send(column.name) %>
    <td><%=trimstring(@names,50)%></td>
  <% end %>
    <td>
        <%= link_if_authorized image_tag('/themes/odotclassic/images/show.png', :title => 'Details'), {:action => 'show', :id => role} %>
        <%= link_if_authorized image_tag('/themes/odotclassic/images/edit.png', :title => 'Edit'), {:action => 'edit', :id => role}  %>
        

        <% if authorized?(:action => 'delete_role') && (not UserEngine.config([:guest_role_name, :user_role_name, :admin_role_name]).include?(role.name)) %>
        <%= link_if_authorized image_tag('/themes/odotclassic/images/delete.png', :title => 'Delete'), {:action => 'delete', :id => role}, {:confirm => "Are you sure you want to delete this role?"}  %>
        <% end %>
    </td>
  </tr>
<% count = count + 1 %>
<% end %>
</table>


</div>

<br/>
<div class="list">
    <%= start_form_tag({:action => 'new'}, :method=>'get') %>
	<table>
	     <th>Actions</th>
         <tr class="even">
            <td>
                <!-- <%= link_if_authorized image_tag('/themes/odotclassic/images/btn_create.gif'), {:action => 'new'}  %> -->
                <!-- %= link_if_authorized submit_tag('Create Role'), {:action => 'new'}  % -->
                <!-- %= link_if_authorized submit_tag('Cancel'), {:controller => "/controlpanel" ,:action => 'list'}  % -->
                
              <%= link_if_authorized image_tag('/themes/odotclassic/images/btn_createrole.png', :alt =>'Create Role'), {:action => 'new'}  %>
			  <%= link_if_authorized image_tag('/themes/odotclassic/images/btn_cancel.gif', :alt =>'Cancel'), {:controller => "/controlpanel" ,:action => 'list'}  %>
            </td>
         </tr>        
	</table>
	<%=end_form_tag%>
</div>

</div>